import http from "../utils/http";
let getGoodsList = (data: UsersData) => http(`goods`, 'GET', data);
//获取商品分类
let getCateList = (type?: '1' | "2" | '3') => http(`categories?type=${type}`);
// 获取商品分类参数或静态属性
let getParamsAttr = (id: number, sel: "only" | "many") => http(`categories/${id}/attributes?sel=${sel}`);
// 上传商品图片
let uploadImg = (data: FormData) => http(`upload`, 'POST', data, {
    'content-type': "multipart/form-data"
})
// 添加商品
let addGoods = (data: AddGoodsParams) => http(`goods`, 'POST', data);
export {
    getCateList,
    getGoodsList,
    getParamsAttr,
    uploadImg,
    addGoods
} 